/*
 *    Copyright (c) 2018-2025, excesysiot All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 *
 * Redistributions of source code must retain the above copyright notice,
 * this list of conditions and the following disclaimer.
 * Redistributions in binary form must reproduce the above copyright
 * notice, this list of conditions and the following disclaimer in the
 * documentation and/or other materials provided with the distribution.
 * Neither the name of the pig4cloud.com developer nor the names of its
 * contributors may be used to endorse or promote products derived from
 * this software without specific prior written permission.
 * Author: excesysiot
 */
package com.excesys.exsecs.access.controller;

import cn.hutool.json.JSONObject;
import com.excesys.exsecs.access.entity.DataFlowOperation;
import com.excesys.exsecs.access.service.DataFlowOperationService;
import com.excesys.exsecs.common.core.util.R;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;

/**
 * 流水表操作
 *
 * @author excesysiot
 * @date 2019-03-31 16:00:20
 */
@RestController
@RequiredArgsConstructor
@RequestMapping("/dataflowoperation")
@Tag(description = "dataflowoperation" , name = "流水表操作" )
public class DataFlowOperationController {

	private final DataFlowOperationService dataFlowOperationService;

	/**
	 * @param
	 * @return
	 */
	@Operation(summary = "数据点历史查询列表" , description = "数据点历史查询列表" )
	@GetMapping("/queryFieldValue")
	public R queryFieldValue(String unitNo, String field, String startTime,String endTime ) {
		String tableName = "t_" + unitNo;
		return R.ok(dataFlowOperationService.queryFieldValue(tableName, field, startTime, endTime, 100));
	}
}
